using System;
using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;
using UnityEngine.UI;

public class HistoryScorePanel : UIPanel
{
    public  TextMeshProUGUI tipsText;
    public  Button          btnClose;
    private LoopScrollRect  m_LoopScrollRect;

    private void Awake()
    {
        btnClose.onClick.AddListener(OnClickClose);
        tipsText.gameObject.SetActive(false);
        m_LoopScrollRect = FindObjectOfType<LoopScrollRect>();
    }

    private void Start()
    {
        if (LocalConfig.intance.scoreList.Count == 0)
        {
            tipsText.gameObject.SetActive(true);
        }
    }

    private void OnEnable()
    {
        m_LoopScrollRect.totalCount    = LocalConfig.intance.scoreList.Count;
        m_LoopScrollRect.RefillCells();
    }

    private void OnClickClose()
    {
        Hide();
    }

    private void Update()
    {
        
    }
}
